home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / pipe.man < prev    next >
Encoding:
Text File  |  1989-01-12  |  2.2 KB  |  133 lines

  1.  
  2.  
  3.  
  4. PIPE                  C Library Procedures                   PIPE
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      pipe - create an interprocess communication channel
  10.  
  11. SSYYNNOOPPSSIISS
  12.      ppiippee((ffiillddeess))
  13.      iinntt ffiillddeess[[22]];;
  14.  
  15. DDEESSCCRRIIPPTTIIOONN
  16.      The _p_i_p_e system call creates an I/O mechanism called a pipe.
  17.      The file descriptors returned can be used in read and write
  18.      operations.  When the pipe is written using the descriptor
  19.      _f_i_l_d_e_s[1] up to 4096 bytes of data are buffered before the
  20.      writing process is suspended.  A read using the descriptor
  21.      _f_i_l_d_e_s[0] will pick up the data.
  22.  
  23.      It is assumed that after the pipe has been set up, two (or
  24.      more) cooperating processes (created by subsequent _f_o_r_k
  25.      calls) will pass data through the pipe with _r_e_a_d and _w_r_i_t_e
  26.      calls.
  27.  
  28.      The shell has a syntax to set up a linear array of processes
  29.      connected by pipes.
  30.  
  31.      Read calls on an empty pipe (no buffered data) with only one
  32.      end (all write file descriptors closed) returns an end-of-
  33.      file.
  34.  
  35.      Pipes are really a special case of the _s_o_c_k_e_t_p_a_i_r(2) call
  36.      and, in fact, are implemented as such in the system.
  37.  
  38.      A signal is generated if a write on a pipe with only one end
  39.      is attempted.
  40.  
  41. RREETTUURRNN VVAALLUUEE
  42.      The function value zero is returned if the pipe was created;
  43.      -1 if an error occurred.
  44.  
  45. EERRRROORRSS
  46.      The _p_i_p_e call will fail if:
  47.  
  48.      [EMFILE]       Too many descriptors are active.
  49.  
  50.      [ENFILE]       The system file table is full.
  51.  
  52.      [EFAULT]       The _f_i_l_d_e_s buffer is in an invalid area of
  53.                     the process's address space.
  54.  
  55. SSEEEE AALLSSOO
  56.      sh(1), read(2), write(2), fork(2), socketpair(2)
  57.  
  58. BBUUGGSS
  59.      Should more than 4096 bytes be necessary in any pipe among a
  60.  
  61.  
  62.  
  63. Sprite v1.0              August 26, 1985                        1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. PIPE                  C Library Procedures                   PIPE
  71.  
  72.  
  73.  
  74.      loop of processes, deadlock will occur.
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0              August 26, 1985                        2
  130.  
  131.  
  132.  
  133.